package cn.icanci.loopstack.bic.common.model.graph;

import cn.icanci.loopstack.bic.common.enums.NodeDataModeEnum;
import cn.icanci.loopstack.bic.common.enums.NodeTypeEnum;
import lombok.Data;

import java.util.Objects;

/**
 * 图结构的节点
 *
 * @author icanci
 * @since 1.0 Created in 2023/09/09 22:13
 */
@Data
public class UnitNodeVO {
    /** 节点UUID */
    private String           nodeUuid;
    /** 样式 */
    private String           styleUuid;
    /** 节点Data模式：前缀匹配、全部匹配 */
    private NodeDataModeEnum nodeDataMode;
    /** 节点DataKey: UseCase-Module-Category-SubCategory */
    private String           nodeDataKey;
    /** 节点类型 */
    private NodeTypeEnum     nodeType;
    /** 节点组件 */
    private String           nodeVue;

    @Override
    public boolean equals(Object object) {
        if (this == object)
            return true;
        if (object == null || getClass() != object.getClass())
            return false;
        UnitNodeVO that = (UnitNodeVO) object;
        return Objects.equals(nodeUuid, that.nodeUuid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(nodeUuid);
    }
}
